Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Integer, ByVal uParam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer

Private Const SPI_SETDESKWALLPAPER = 20
Private Const SPIF_UPDATEINIFILE = &H1

Private Function ChangeWallpaper(ByVal sLink As String)
    Dim Image As System.Drawing.Image
    Dim WebClient As New System.Net.WebClient()
    Dim sExt As String = sLink.Substring(sLink.Length - 4)

    If Not System.IO.File.Exists(System.IO.Path.GetTempPath + "wallpaper" + sExt) Then
        WebClient.DownloadFile(sLink, System.IO.Path.GetTempPath + "wallpaper" + sExt)
    Else
        System.IO.File.Delete(System.IO.Path.GetTempPath + "wallpaper" + sExt)
        WebClient.DownloadFile(sLink, System.IO.Path.GetTempPath + "wallpaper" + sExt)
    End If

    Image = Image.FromFile(System.IO.Path.GetTempPath + "wallpaper" + sExt)
    Image.Save(System.IO.Path.GetTempPath + "\wallpaper.bmp", System.Drawing.Imaging.ImageFormat.Bmp)
    SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, System.IO.Path.GetTempPath + "\wallpaper.bmp", SPIF_UPDATEINIFILE)

    Return Nothing
End Function


'Usage:

ChangeWallpaper("http://www.darjanpanic.com/content/tutorials/2-lights-in-dark/wallpaper_1024x768.jpg")
ChangeWallpaper("http://www.theimp.tv/images/wallpaper-1024.gif")